<extend name="Base/base" />
<block name="button">
	
	<button class="btn btn-primary" type="submit" form="form"><i class="fa fa-save"></i> {:L('text_save')}</button>
</block>
<block name="body">
	<if condition="$msg">
		<div class="alert alert-danger alert-dismissible fade in" role="alert">
		      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
		      {$msg.warning}

		    </div>
	</if>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4><i class="fa fa-pencil fa-fw"></i>  {$heading_title}</h4>
		</div>
		<div class="panel-body">
			<form action="__SELF__" method="post" id="form" class="form-horizontal">	
				<ul class="nav nav-tabs">
					<foreach name="setting_group" key="k" item="sg">
						<li class="{$k?'':'active'}"><a href="#group-{$sg.setting_group_id}" data-toggle="tab">{$sg.title}</a></li>
					</foreach>
				</ul>
				<div class="tab-content">
					<foreach name="setting_group" key="k" item="sg">
					<div class="tab-pane {$k?'':'active'}" id="group-{$sg.setting_group_id}">
						<ul class="nav nav-tabs">
							<foreach name="languages" key="key" item="language">
								<li class="{$key?'':'active'}">
									<a href="#language-{$sg.setting_group_id}-{$language.language_id}" data-toggle="tab"><img src="__PUBLIC__/Images/flags/{$language.image}">  {$language.name}</a>
								</li>
							</foreach>
						</ul>
						<div class="tab-content">
							<foreach name="languages" key="key" item="language">
								<div class="tab-pane {$key?'':'active'}" id="language-{$sg.setting_group_id}-{$language.language_id}">
									<foreach name="sg['setting']" item="setting">
										<div class="form-group">
											<label for="input-{$setting.key}-{$language.language_id}" class="col-sm-2 control-label">{$setting.title}</label>
											<div class="col-sm-10">
												<switch name="setting['type']">
													<case value="0">
														<input name="{$setting.key}[{$language.language_id}]" class="form-control" placeholder="{$setting.title}" value="{$setting['value'][$language['language_id']]|default=''}">
													</case>
													<case value="1">
														<textarea name="{$setting.key}[{$language.language_id}]" class="form-control" placeholder="{$setting.title}" rows="5">{$setting['value'][$language['language_id']]|default=''}</textarea>
													</case>
													<case value="2">
														<a href="" id="thumb-image-{$setting.key}-{$language.language_id}" data-toggle="image" class="img-thumbnail"><img src="{$setting['thumb'][$language['language_id']]}" alt="" title="" data-placeholder="{$placeholder}" /></a>
                  										<input type="hidden" name="{$setting.key}[{$language.language_id}]" value="{$setting['value'][$language['language_id']]|default=''}" id="input-{$setting.key}-{$language.language_id}" />
													</case>
													<case value="3">
														<textarea name="{$setting.key}[{$language.language_id}]" placeholder="{$setting.title}" class="summernote"  id="input-{$setting.key}-{$language.language_id}">{$setting['value'][$language['language_id']]|default=''}</textarea>
													</case>
												</switch>
											</div>
										</div>
									</foreach>
								</div>
							</foreach>
						</div>
									
					</div>
					</foreach>
				</div>
			</form>			
		</div>		
	</div>
</block>
